<template>
  <div class="container">
    <!-- 搜索 -->
    <div>
      <isearch />
    </div>
    <!-- 站长介绍 -->
    <div>
      <myself />
    </div>
    <!-- 欢迎标语 -->
    <div>
      <iwelcome />
    </div>
    <!-- 时间 -->
    <div>
      <itime />
    </div>
    <!-- 天气 -->
    <div>
      <iweather />
    </div>
    <!-- 精选文章 -->
    <div>
      <ihotArticle />
    </div>
    <!-- 站长推荐 -->
    <div></div>
  </div>
</template>

<script>
import isearch from '@/components/common/search'
import myself from '@/components/common/myself'
import iwelcome from '@/components/common/welcome'
import itime from '@/components/common/time'
import iweather from '@/components/common/weather'
import ihotArticle from '@/components/common/hotArticle'
export default {
    data() {
        return {
            // isArticleContent: false
        }
    },    
    components: {
      isearch,
      myself,
      iwelcome,
      itime,
      iweather,
      ihotArticle
    },
    created() {
      this.isArticle();
    },
    methods: {
      isArticle() {
        if(this.$route.path === '/article'){
          this.$store.commit('setIsArticleContent', true);
          this.$store.commit('setArticleId', 20);
          // console.log(this.$store.state.articleId);
        } else {
          this.$store.commit('setIsArticleContent', false);
        }
      }
    },
}
</script>

<style lang="less" scoped>
.container {
  margin: 0 auto;
  min-height: 100vh;
  margin-left: 20px;
  padding: 5px;
  div {
    margin-bottom: 10px;
  }
}
</style>
